home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 5
/
Aminet 5 - March 1995.iso
/
Aminet
/
mus
/
midi
/
midiplay230a.lha
/
MidiPlay
/
ARexx
/
Example3.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-10-09
|
1KB
|
54 lines
/* This is an example ARexx script for use with MidiPlay.
Use the following parameter: FILETYPEREXX=ThisScript.rexx
When MidiPlay cannot load a file, because it is not a MIDI file, it
calls ThisScript. Argument consists of drive, path, file and extension
of the filename.
This particular example tries to unarchive a file with extension lha
to a directory ram:t/rxmidi. If unarchiving is succesful, the first .MID
file is played by sending command 'FILE first.MID' to MidiPlay.
*/
lhadir = 'sys:archivers/'
options results
parse arg Drive ',' Path ',' File ',' Extension .
address command
if ~show('L',"rexxsupport.library") then do
if ~addlib('rexxsupport.library',0,-30,0) then
exit 10
end
if ~exists('t:rxmidi') then
'makedir t:rxmidi'
if Path == "" then Path2 = Path
else Path2 = Path || '/'
Whole = '"' || Drive || Path2 || File || '.' || Extension || '"'
"delete >nil: t:rxmidi/#?"
if Extension='lha' | Extension='LHA' then
lhadir'lha >nil: -x0 -q e 'Whole' t:rxmidi/'
else do
say 'Not a MIDI file' Whole
RETURN
end
dir1=showdir('t:rxmidi/','f','@')
dir1=insert(dir1,'@')
dir2=upper(dir1)
position=index(dir2,'.MID')
position3=lastpos('@',dir2,position)
position2=index(dir2,'.MID',position)
filenam=substr(dir2,position3+1,(position2-position3)+3)
address "MidiPlay_rexx"
'FILE t:rxmidi/'filenam